# def merge_sort(arr):
#     if len(arr) <= 1:
#         return arr
#
#     mid = len(arr) // 2
#     left_half = arr[:mid]
#     right_half = arr[mid:]
#
#     left_half = merge_sort(left_half)
#     print(left_half)
#     right_half = merge_sort(right_half)
#
#     return merge(left_half, right_half)
#
#
# def merge(left, right):
#     merged = []
#     left_index = 0
#     right_index = 0
#
#     while left_index < len(left) and right_index < len(right):
#         if left[left_index] < right[right_index]:
#             merged.append(left[left_index])
#             left_index += 1
#         else:
#             merged.append(right[right_index])
#             right_index += 1
#
#     while left_index < len(left):
#         merged.append(left[left_index])
#         left_index += 1
#
#     while right_index < len(right):
#         merged.append(right[right_index])
#         right_index += 1
#
#     return merged
#
#
# # 示例用法
# arr = [4, 3, 2, 1]
# sorted_arr = merge_sort(arr)
# print(sorted_arr)
# print(2**63 > 100000000000)
# num = 0
# buttle_num = 0
# money = 40
# while money > 0:
#     money -= 2
#     num += 1
#     buttle_num += 1
#     if buttle_num == 2:
#         buttle_num = 0
#         num += 1
#
# print(num)
# height = 0
# day = 0
# while True:
#     day += 1
#     height += 2
#     if height >= 10:
#         break
#     else:
#         height -= 1
#
# print(day)
# def cal_max_num(money, price, exchange_rate):
#     num = money // price
#     buttle_num = num
#     while buttle_num >= exchange_rate:
#         num += buttle_num // exchange_rate
#         buttle_num = buttle_num % exchange_rate + buttle_num // exchange_rate
#     return num
#
# print(cal_max_num(40, 2, 2))
# import smtplib
# import pyunittest
#
# import smtplib
# from email.mime.multipart import MIMEMultipart
# from email.mime.text import MIMEText
# from email.mime.base import MIMEBase
# from email import encoders
# from email.header import Header
# from email.utils import formataddr
#
# # 任务二：4.邮件发送代码，将刚才生成的测试报告做成附件发送到邮箱里
# # 邮件配置信息
# sender_email = 'qaz242@foxmail.com'  # 发件人邮箱地址
# sender_password = 'raywfqiybgizdich'  # 发件人邮箱密码或授权码
# receiver_emails = ['wyguolai@163.com']  # 接收人邮箱地址列表
# subject = '这是一份测试报告，请查收！'  # 邮件主题
# html_file_path = 'pyunittest\计算器.html'  # HTML 文件的路径
#
# # 创建邮件对象
# msg = MIMEMultipart()
# msg['Subject'] = Header(subject, 'utf-8')  # 设置主题，并指定字符编码
# msg['From'] = formataddr((str(Header('随便', 'utf-8')), sender_email))   # 设置发件人名称，并指定字符编码
# msg['To'] = Header(', '.join(receiver_emails), 'utf-8')  # 设置收件人名称，并指定字符编码
#
# # 读取 HTML 文件内容
# with open(html_file_path, 'r', encoding='utf-8') as file:
#     html_content = file.read()
#
# # 创建 HTML 正文
# html_part = MIMEText(html_content, 'html')
# msg.attach(html_part)
#
# # 读取附件文件
# attachment_file_path = 'pyunittest\计算器.html'  # 附件文件的路径
# attachment_filename = '计算器.html'  # 附件文件的名称
#
# with open(attachment_file_path, 'rb') as file:
#     attachment = MIMEBase('application', 'octet-stream')
#     attachment.set_payload(file.read())
#     encoders.encode_base64(attachment)
#     encoded_filename = Header(attachment_filename, 'utf-8').encode()
#     attachment.add_header('Content-Disposition', f'attachment; filename="{encoded_filename}"')
#     msg.attach(attachment)
#
# # 发送邮件
# try:
#     with smtplib.SMTP_SSL('smtp.qq.com', 465) as server:
#         server.login(sender_email, sender_password)
#         server.sendmail(sender_email, receiver_emails, msg.as_string())
#     print('邮件发送成功！')
# except Exception as e:
#     print('邮件发送失败:', e)
# from selenium import webdriver
# import time
# # 创建谷歌浏览器对象
# from selenium.webdriver.common.by import By
#
# chromeDriver = webdriver.Chrome()
#
# # 打开百度网址
# chromeDriver.get("http://www.baidu.com")
#
# # 窗口最大化
# chromeDriver.maximize_window()
#
# #寻找搜索输入框
# chromeDriver.find_element(By.ID, "kw").send_keys("java")
#
# # 点击百度一下按钮
# chromeDriver.find_element(By.ID, "su").click()
#
# time.sleep(30)
# # 退出浏览器
# chromeDriver.quit()

# test_tuple = (())
# print(type(test_tuple))
# print(len(test_tuple))
# tuple1 = (1, 2, 3)
# tuple2 = (1, 2)
# print(tuple1 - tuple2)
# import time
#
# from selenium import webdriver
#
# driver = webdriver.Chrome()
# driver.maximize_window()
# driver.get('https://pan.baidu.com/disk/main?_at_=1688722070065#/index?category=all')
# time.sleep(2)
# import xlrd
#
# book = xlrd.open_workbook(filename=filepath)
# sheet = book.sheet_by_name(sheetname)
# row_num = sheet.nrows
# for i in range(1, row_num):
#     loan_data.append(sheet.row_values(i))
# from faker import Faker
#
# fa = Faker("zh_CN")
# test = 'str1'
# print(test[3])































